package com.study.d7_otherstream;

import java.io.*;

public class TransDemo {
    public static void main(String[] args) {
        //目标：字符输入转换流
        try (
                //1、得到GBK文件的原始字节输入流
                InputStream is = new FileInputStream("\\C:\\Users\\51230\\Desktop\\av.txt");
                //2、通过字符输入转换把原始字节流按照指定编码转换成字符输入流
                Reader re = new InputStreamReader(is, "UTF-8");
                //3、把字符输入流包装成高级的缓冲字符输入流
                BufferedReader br = new BufferedReader(re);
        ) {
                //4、按行读取
                String line;
                while((line=br.readLine())!=null){
                    System.out.println(line);
                }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
